import Http from "./Http";

type DateRangeType = 1 | 2 | 3


export async function deviceWarnTypeStatisticsData(type:DateRangeType) {
    let result = await Http.get('fire/alert/deviceAlertTypeTotal', { type })
    return result.success ? result.data : null
}

export async function warnTotalOverview() {
    let result = await Http.get('fire/alert/todayTotal')

    return result.success ? result.data : null
}

export async function warnTotalRank(type:DateRangeType) {
    let result = await Http.get('fire/alert/fireAlertRank', { type })
    return result.success ? result.data : null
}

export async function warnProvinceRank(type:DateRangeType) {
    let result = await Http.get('fire/alert/provinceRank', { type })
    return result.success ? result.data : null
}

export async function mapWarnData() {
    let result = await Http.get('fire/alert/fireAlertList')
    return result.success ? result.data : null
}


export function fireDeviceListPagination(queryParams:{[key:string]:any}) {
    return Http.get('fire/alert/fireDeviceList', queryParams)
}

export async function exportFireDeviceList(queryParams:{[key:string]:any}) {
    let result = await Http.get('fire/alert/exportFireDeviceList', queryParams)
    return result.success ? result.data : null
}



export async function chargeFinishReasonApi(type:number) { //充电结束原因
    let result = await Http.get('statistic/order/totalChargeResult', {type})
    return result.data
}

export async function chargeTimeLongApi() { //充电时长
    let result = await Http.get('statistic/order/totalTodayHourInterval')
    return result.data
}

export async function payTypeApi() { //支付类型
    let result = await Http.get('statistic/device/totalDevicePayType')
    return result.data
}



